﻿#region Copyright(C) 2010-2010 NCS Pte. Ltd. All rights reserved.
// ==================================================================================================
// Copyright(C) 2010 NCS Pte. Ltd. All rights reserved.
//
// SYSTEM NAME	    : iConnect .Net Application Framework
// COMPONENT ID	    : CBEC.Core.Wcf
// COMPONENT DESC   : Core components for WCF.	
//
// CREATED DATE/BY  : 18 Aug 2010 / Gao Ye
//
// REVISION HISTORY :	
// DATE/BY			SR#/CS/PM#/OTHERS		DESCRIPTION OF CHANGE
// ==================================================================================================
#endregion

using System.IO.Compression;
using System.IO;
using System;

namespace CBEC.Core.Wcf.Compression
{
    /// <summary>
    /// The Deflate algrithm based <see cref="Compressor"/>.
    /// </summary>
    public class DeflateCompressor : Compressor
    {

        /// <summary>
        /// Gets the compression stream creator.
        /// </summary>
        public override Func<Stream, CompressionMode, bool, Stream> CompressionStreamCreator
        {
            get { return (stream, mode, leaveOpen) => new DeflateStream(stream, mode, leaveOpen); }
        }

        /// <summary>
        /// Gets the type of the content.
        /// </summary>
        /// <value>
        /// The type of the content.
        /// </value>
        public override string ContentType
        {
            get { return "application/x-deflate"; }
        }

        /// <summary>
        /// Gets the type of the media.
        /// </summary>
        /// <value>
        /// The type of the media.
        /// </value>
        public override string MediaType
        {
            get { return "application/x-deflate"; }
        }
    }
}
